﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cherry.Agile.Serialize.Json {
    public static class JsonHelper {
        public static string JsonSerialize(this object val) {
            return Newtonsoft.Json.JsonConvert.SerializeObject(val);
        }

        public static object JsonDeserialize(this string val) {
            return Newtonsoft.Json.JsonConvert.DeserializeObject(val);
        }

        public static T JsonDeserialize<T>(this string val) {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(val);
        }
    }
}
